
inline zval *evilworlds_registry_get(const char *key) {
	zval *reg_key, *ret; 
	
	MAKE_STD_ZVAL(ret); 
	MAKE_STD_ZVAL(reg_key); 
	
	ZVAL_STRING(reg_key, key, 1); 
	
	if (!call_function(EVILWORLDS_NS "\\Registry::get", NULL, ret, 1, reg_key)) {
		FREE_ZVAL(ret); 
		ret = NULL; 
	}
	FREE_ZVAL(reg_key); 
	return ret; 
}

inline zval *evilworlds_get_config(const char *config, const char *section, const char *property) {
	uint arguments = 1; 
	zval *args[3], *ret; 
	
	MAKE_STD_ZVAL(ret); 
	MAKE_STD_ZVAL(args[0]); 
	MAKE_STD_ZVAL(args[1]); 
	MAKE_STD_ZVAL(args[2]); 
	
	ZVAL_STRING(args[0], config, 1); 
	if (section) {
		ZVAL_STRING(args[1], section, 1); 
		if (property) {
			ZVAL_STRING(args[2], property, 1); 
			++arguments; 
		}
		++arguments; 
	}
	if (!call_function(EVILWORLDS_NS "\\Config::get", NULL, ret, arguments, args)) {
		FREE_ZVAL(ret); 
		ret = NULL; 
	}
	FREE_ZVAL(args[0]); FREE_ZVAL(args[1]); FREE_ZVAL(args[2]); 
	return ret; 
}
